/**
 * Copyright (C) 2013-2014 the original author or authors.
 */
package com.foreveross.bsl.system.model.domain;

import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.foreveross.bsl.mongodb.domain.Entity;

/**
 * @description
 * 
 * @author rening
 * @version v1.0
 * 
 * @2013-6-8
 * 
 */
@Document(collection = "account")
public class Account extends Entity {

	@Id
	private String id;

	@Field("username")
	private String username;

	@Field("password")
	private String password;

	@Field("name")
	private String name;

	@Field("status")
	private String status;

	@Field("account_type")
	private String accountType;

	@Field("create_date")
	private Date createDate;

	@Field("update_date")
	private Date updateDate;

	@DBRef
	private Account parent;

	@Field("auth_type")
	private String authType;

	@Field("admin_auth_type")
	private String adminAuthType;

	public Page<Account> findByPageable(Pageable pageable, Account account) {
		return this.getEntityRepository().findAll(pageable);
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username
	 *            the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the accountType
	 */
	public String getAccountType() {
		return accountType;
	}

	/**
	 * @param accountType
	 *            the accountType to set
	 */
	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * @param status
	 *            the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * @return the createDate
	 */
	public Date getCreateDate() {
		return createDate;
	}

	/**
	 * @param createDate
	 *            the createDate to set
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * @return the updateDate
	 */
	public Date getUpdateDate() {
		return updateDate;
	}

	/**
	 * @param updateDate
	 *            the updateDate to set
	 */
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	/**
	 * @return the parent
	 */
	public Account getParent() {
		return parent;
	}

	/**
	 * @param parent
	 *            the parent to set
	 */
	public void setParent(Account parent) {
		this.parent = parent;
	}

	/**
	 * @return the authType
	 */
	public String getAuthType() {
		return authType;
	}

	/**
	 * @param authType
	 *            the authType to set
	 */
	public void setAuthType(String authType) {
		this.authType = authType;
	}

	/**
	 * @return the adminAuthType
	 */
	public String getAdminAuthType() {
		return adminAuthType;
	}

	/**
	 * @param adminAuthType
	 *            the adminAuthType to set
	 */
	public void setAdminAuthType(String adminAuthType) {
		this.adminAuthType = adminAuthType;
	}

}
